package com.atmilan.quartz.sync.pull.daigo.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.atmilan.quartz.model.entity.daigo.DaigoProductSku;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author hupeng
 * @since 2020-04-27
 */
@DS("source_hiku")
public interface DaigoProductSkuMapper extends BaseMapper<DaigoProductSku> {

    int replaceIntoSku(DaigoProductSku daigoProductSku);

    int deleteByGoodsIds(@Param("goodsIds") List<String> goodsIds);

    List<String> findDeleteSkuIds(@Param("startTime") Date startTime);
    
    @Update("truncate table daigo_product_sku")
    void deleteAll();
    
    @Update("truncate table daigo_product_sku_back")
    void deleteProductSkuBack();
    
    @Update("insert into daigo_product_sku_back select * from daigo_product_sku")
    void copyProductSkuBack();

}
